﻿
@{
    Layout = null;
}
@{
    JObject o = null;
    try
    {
        o = JObject.Parse(Fn.DecryptDES(Query.GetString().TrimStart('?')));
    }
    catch
    {
        return;
    }
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>页面刷新过于频繁</title>
    <script type="text/javascript" src="@(Env.TcmBaseURL)/Server/lib/avalon.js"></script>
    <style>
        .txt  {
            margin: 40px auto;
            text-align: center;
        }
        .flush {
            margin: 40px auto;
            text-align: center;
        }
            .flush button{
                width: 100px;
                height: 25px;
            }
    </style>
    <script>
        var body = avalon.define({
            $id: 'body',
            limitTime: @o["limitTime"],
            reset: function () {
                var me = this;
                setTimeout(function () {
                    if (body.limitTime > 0) {
                        body.limitTime = body.limitTime - 1;
                        me.reset();
                    }
                }, 1000);
            },
            flush: function () {
                window.location.replace('@Html.Raw(o["ret"])');
            }
        });
        body.$watch('onReady', function () {
            body.reset();
        })
    </script>
</head>

<body ms-controller='body'>
    <br />
    <br />
    <br />
    <div class="txt">页面刷新过于频繁, 请稍后再试! <span class="min" :if="@@limitTime>0">{{limitTime}}</span></div>
    <div class="flush"><button :attr="{disabled:@@limitTime>0}" :click="@@flush">重新加载</button></div>
</body>
</html>
